package datastructure.array;

/**
 *
 * @author Lei Zhang
 */
public class GeneralFunctions {
  private GeneralFunctions() {
  }

  public static void exchange(int[] array, int i, int j) {
    int tmp = array[i];
    array[i] = array[j];
    array[j] = tmp;
  }

  public static void reverse(int[] array, int start, int end) {
    
    while (start < end) {
      exchange(array, start++, end--);
    }
  }
}
